package asa;

/**
 * vetores não são suportados ainda. Corrigir
 * @author José
 *
 */

public class VariableExpr extends Expr {

    public VariableExpr( Variable v ) {
        this.v = v;
        arrayIndex = null;
    }

    @Override
	public void genJava(PWInterface pw) {
    	genJava(pw, false);
    }

    @Override
	public void genJava(PWInterface pw, boolean putParenthesis ) {
        pw.print( v.getName() );
    }

	public void setArrayIndex(Expr arrayIndex) {
		this.arrayIndex = arrayIndex;
	}


	public Expr getArrayIndex() {
		return arrayIndex;
	}
    private Expr arrayIndex;


    private Variable v;
}